package 双指针.移动零283;

import utils.Utils;

public class Solution {
    public static void moveZeroes(int[] nums) {
        for(int i=0,j=0;j<nums.length;){
            if(nums[j] != 0){
                int s = nums[i];
                nums[i] = nums[j];
                nums[j] = s;
                i++;
            }
            j++;
        }
    }

    public static void main(String[] args) {
        int[] nums = {0,1,0,3,12};
        moveZeroes(nums);
        Utils.printIntArr(nums);
    }
}
